package com.cyw.consumer.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: CYW
 * @Date: 2021/1/4 15:27
 * WorkConsumer
 */
@Component
public class WorkConsumer {
    /**
     * 第一个消费者,work是队列名
     * @param message
     */
    @RabbitListener(queuesToDeclare = @Queue(value = "work"))
    public void receive1(String message){
        System.out.println("message1"+message);
    }

    @RabbitListener(queuesToDeclare = @Queue(value = "work"))
    public void receive2(String message){
        System.out.println("message2"+message);
    }
}
